/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package supervise;

import jwnl.JWNLDistances;

/**
 *
 * @author mida
 */
public class Element {

    String Value;

    public Element(String V) {
        Value = V;
    }

    @Override
    public String toString() {
        return this.Value;
    }

    boolean equals(String V) {
        return (this.Value.equals(V.toLowerCase()));
    }

    double distance(String S, JWNLDistances d) {
        double dSim = d.computeSimilarity(this.Value, S) * 100;
        System.out.println("computeSimilarity(" + S + ", " + this.Value + ")=" + (100 - dSim));
        return dSim;
    }

    double distance(Ensemble e, JWNLDistances d) {
        double dSim = 0.0;
        for (int i = 0; i < e.size(); i++) {
            dSim += this.distance(e.get(i).toString(), d);
        }
        return dSim / e.size();
    }
}
